//递归：
#include <stdio.h>

int Factorial(int x)
{
    if (x <= 1)
        return 1;
    else
        return x * Factorial(x - 1);
}

int main()
{
    int n = 0;
    scanf("%d", &n);
    int ret = Factorial(n);
    printf("%d", ret);
    return 0;
}

//迭代：
#include <stdio.h>

int Factorial(int x)
{
    int i = 0;
    int ret = 1;
    for(i = 1; i <= x; i++)
    {
        ret *= i;
    }
    return ret;
}

int main()
{
    int n = 0;
    scanf("%d", &n);
    int ret = Factorial(n);
    printf("%d", ret);
    return 0;
}